package nccloud.web.pu.storereq.refer;

import nccloud.framework.web.processor.refgrid.RefQueryInfo;
import nccloud.framework.web.processor.reftree.TreeRefQueryInfo;
import nccloud.framework.web.ui.meta.RefMeta;
import nccloud.web.refer.DefaultGridRefAction;
import nc.bs.framework.common.InvocationInfoProxy;
import nccloud.commons.lang.StringUtils;

/**
  * 停用原因参照
 * @author humf
 *
 */
public class GbyyQueryAction extends DefaultGridRefAction {

	@Override
	public RefMeta getRefMeta(RefQueryInfo refQueryInfo) {
		RefMeta refMeta = new RefMeta();
		refMeta.setCodeField("code");
		refMeta.setNameField("name");
		refMeta.setTableName("(select code,name,pk_defdoc as pk_tyyy from bd_defdoc where pk_defdoclist in (select pk_defdoclist from bd_defdoclist where name = '申请单关闭原因'))");
		refMeta.setPkField("pk_tyyy");
		String[] extraFields = new String[] {"code","name","pk_tyyy"};
		refMeta.setExtraFields(extraFields);
		refMeta.setMutilLangNameRef(false);
		return refMeta;
	}
	
	public String getExtraSql(RefQueryInfo paramRefQueryInfo, RefMeta paramRefMeta) {
//		String pk_org = paramRefQueryInfo.getQueryCondition().get("pk_org");
//		InvocationInfoProxy.getInstance().getGroupId();
		StringBuffer sb = new StringBuffer();
//		if("123".equals(pk_org)) {
//			sb.append(" and name != '新增流程中'");
//		}
		String result = sb.toString();
		return result;
	}

}
